﻿@{
    ViewData["Title"] = "部署工具";
}
<script>
    $(document).ready(function () {
        const connection = new signalR.HubConnectionBuilder()
            .withUrl("/log")
            .build();

        connection.on("ReceiveData", function (data) {

            var consoleElement = document.getElementById('console');
            var output = `<div class="output">${data}</div>`;
            consoleElement.innerHTML += output;
            consoleElement.scrollTop = consoleElement.scrollHeight; // 滚动到底部
        });

        connection.start().catch(function (err) {
            return console.error(err.toString());
        });

    });
</script>

<div class="container mt-5">
    <div class="card">
        <div class="card-header">
            实时日志输出
        </div>
        <div class="card-body p-0">
            <div class="console" id="console">
                <!-- 这里将显示日志信息 -->
            </div>
        </div>
    </div>

</div>

